//
//  MBFloorCell.m
//  发布求租
//
//  Created by MB__Lee on 2018/6/9.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "MBFloorCell.h"

@interface MBFloorCell()<UITextFieldDelegate>

@property (weak, nonatomic) IBOutlet UILabel *xingLabel;
@property (weak, nonatomic) IBOutlet UITextField *allFloorText;
@property (weak, nonatomic) IBOutlet UITextField *floorText;

@end

@implementation MBFloorCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.xingLabel.hidden = YES;
    self.allFloorText.delegate = self;
    self.floorText.delegate = self;

    self.allFloorText.tag = 100;
    self.floorText.tag = 101;
    
    // Initialization code
}



-(void)setCMModel:(MBCommonCellModel *)CMModel{
    [super setCMModel:CMModel];
    
    if (self.CMModel.hasX) {
        self.xingLabel.hidden = NO;
    }else{
        self.xingLabel.hidden = YES;
    }
    
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return  YES;
}
-(void)textFieldDidEndEditing:(UITextField *)textField{
    if (textField.tag == 100) {
        self.CMModel.sourceAllFloor = textField.text;
        
    }else if (textField.tag == 101){
        self.CMModel.sourceAtFloor = textField.text;
    }
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
